<?php
use Jialeo\LaravelSchemaExtend\Schema;
//use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShopUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_users', function (Blueprint $table) {
            $table->comment = '商城会员表';
            $table->increments('id')->comment('会员ID');
            $table->string('xcx_open_id',100)->default('')->comment('小程序openId');
            $table->string('anonymous_openid',100)->default('')->comment('匿名用户在当前小程序的ID');
            $table->string('gzh_open_id',100)->default('')->comment('公众号openId');
            $table->string('union_id',100)->default('')->comment('微信unionId');
            $table->string('phone',20)->default('')->comment('手机号');
			$table->string('password')->default('')->comment('密码');
            $table->string('nick_name',40)->default('')->comment('昵称');
            $table->string('avatar_url')->default('')->comment('第三方头像');
            $table->tinyInteger('status')->default(1)->comment('状态:0=禁用,1=启用');
			$table->tinyInteger('type')->default(1)->comment('登录方式:1=微信小程序,2=字节小程序');
            $table->tinyInteger('gender')->default(0)->comment('性别:0=未知,1=男,2=女');
            $table->timestamp('created_at')->nullable()->comment('注册时间');
			$table->timestamp('updated_at')->nullable()->comment('更新时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_users');
    }
}
